<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      登录日志详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="自增主键：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="系统基础管理=1：">
          <span>{{formData.user_type}}</span>
        </el-form-item>
        <el-form-item label="用户id：">
          <span>{{formData.user_id}}</span>
        </el-form-item>
        <el-form-item label="登录用户名：">
          <span>{{formData.user_name}}</span>
        </el-form-item>
        <el-form-item label="日志内容：">
          <span>{{formData.log_memo}}</span>
        </el-form-item>
        <el-form-item label="登录ip：">
          <span>{{formData.log_ip}}</span>
        </el-form-item>
        <el-form-item label="登录系统信息：">
          <span>{{formData.os}}</span>
        </el-form-item>
        <el-form-item label="登录浏览器信息：">
          <span>{{formData.browser}}</span>
        </el-form-item>
        <el-form-item label="创建时间：">
          <span>{{formData.create_time}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  qr_sys_login_logsInfo
} from '@/api/project/wmyw/project_wmyw_qr_sys_login_logs'
export default {
  name: "a_wmywa_qr_sys_login_logs_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        user_type: 0, 
        user_id: 0, 
        user_name: '', 
        log_memo: '', 
        log_ip: '', 
        os: '', 
        browser: '', 
        create_time: '2020/8/11 15:00:35', 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      qr_sys_login_logsInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.user_type = r.dataSingle.user_type, 
        this.formData.user_id = r.dataSingle.user_id, 
        this.formData.user_name = r.dataSingle.user_name, 
        this.formData.log_memo = r.dataSingle.log_memo, 
        this.formData.log_ip = r.dataSingle.log_ip, 
        this.formData.os = r.dataSingle.os, 
        this.formData.browser = r.dataSingle.browser, 
        this.formData.create_time = r.dataSingle.create_time, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
